package com.zb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zb.entity.ZjWorkDispatchEngineer;
import com.zb.entity.ZjWorkEngineerSign;
import com.zb.extend.NetworkEmpDispatchOrderListExtend;
import com.zb.mobile.NetworkMobileOrderListSelectVo;
import com.zb.mobile.NetworkOrderStatusQtyVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 工单分派工程师表 Mapper 接口
 * </p>
 *
 * @author WEN
 * @since 2023-10-23
 */
@Repository
public interface ZjWorkDispatchEngineerMapper extends BaseMapper<ZjWorkDispatchEngineer> {

    /**
     * 根据服务人员ID获取未确认接单数量
     * @param networkEmpId 服务人员ID
     * @return
     */
    long getWaitReceivingOrderQty(@Param("networkEmpId") Long networkEmpId);

    /**
     * 根据服务人员ID获取未签到的工单数量
     * @param custAccId 商家ID
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @return
     */
    long getWaitSignInOrderQty(@Param("custAccId") Long custAccId, @Param("networkId") Long networkId, @Param("networkEmpId") Long networkEmpId);

    /**
     * 获取服务商工单列表状态数量
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param keyword 搜索关键词：工单单号/一物一码/产品名称/产品型号
     * @return
     */
    NetworkOrderStatusQtyVo getNetworkOrderListStatusQty(@Param("networkId") Long networkId, @Param("networkEmpId") Long networkEmpId, @Param("keyword") String keyword);

    /**
     * 获取工程师工单列表
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param selectVo 搜索条件
     * @return
     */
    List<NetworkEmpDispatchOrderListExtend> getNetworkEmpOrderList(@Param("custAccId") Long custAccId, @Param("networkId") Long networkId, @Param("networkEmpId") Long networkEmpId, @Param("selectVo") NetworkMobileOrderListSelectVo selectVo);
    /**
     * 获取工程师工单列表总记录数
     * @param networkId 服务商ID
     * @param networkEmpId 服务人员ID
     * @param selectVo 搜索条件
     * @return
     */
    long getNetworkOrderListCount(@Param("custAccId") Long custAccId, @Param("networkId") Long networkId, @Param("networkEmpId") Long networkEmpId, @Param("selectVo") NetworkMobileOrderListSelectVo selectVo);

    ZjWorkDispatchEngineer getZjWorkDispatchEngineer(@Param("id") Long id);

    Long getIsHxTotal();

    Long getIsPauseTotal();

    ZjWorkEngineerSign getEngineerSignTime(@Param("id") Long id);
}
